package com.bird.main;

import java.awt.*;
import java.awt.image.BufferedImage;

public class Cloud {
    //移动速度
    private int speed;
    //鸟的位置
    private int x, y;
    private BufferedImage img;

    public Cloud() {
    }

    public Cloud(int speed, int x, int y, BufferedImage img) {
        this.speed = speed;
        this.x = x;
        this.y = y;
        this.img = img;
    }


    public void draw(Graphics g) {
        //给云一个速度
        x -= speed;
        g.drawImage(img, x, y, null);
    }


    //    用于判断云是否飞出窗口
    public boolean isOutFrame() {
        return x < -100;
    }


}
